/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaproject;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;


/** 
 *
 * @author hanxiao
 */

public class ImportDb {
    
    public static Connection getConnection(){
        Connection con = null;
        try {
            Class.forName("com.mysql.jdbc.Driver");
            con = DriverManager.getConnection(
                    "jdbc:mysql://localhost:3306/project","root","19911126");
        }catch (ClassNotFoundException ex) {
            System.out.println("ImportDb class");
            System.out.println("Driver test false! " + ex);
        }catch (SQLException e) {
            System.out.println("ImportDb class");
            System.out.println("Database connect false" + e);
        }
        return con;
    }
    
}
